package com.fneuch.mwg.army;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;



public class ArmyList extends ArrayList<Unit> implements List<Unit> {

	/**
	 * To stop the serialization complaint
	 */
	private static final long serialVersionUID = -5878341581642185226L;

	public boolean removeUnitbyName(String modelName) {
		boolean trouver = false; 
		for(Iterator<Unit> iterators = listIterator(); iterators.hasNext() && !trouver; ) {
			if(iterators.next().getName().equalsIgnoreCase(modelName)) {
				iterators.remove();
				trouver = true;
			}
		}
		return trouver;
		
	}

}
